using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Outpatient.Doman.SmartClinic
{
    /// <summary>
    /// 病人挂号实体类
    /// </summary>
    [Table("Patient_registration")]
    public class Patient_registration
    {
        /// <summary>
        /// 挂号ID - 主键，自增
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Patient_registrationId { get; set; }

        /// <summary>
        /// 挂号单编号
        /// </summary>
        [Required]
        [StringLength(20)]
        public string RegisterNo { get; set; } = string.Empty;

        /// <summary>
        /// 挂号类别ID - 外键
        /// </summary>
        public int RegisterTypeId { get; set; }

        /// <summary>
        /// 就诊医生ID - 外键
        /// </summary>
        public int DoctorId { get; set; }

        /// <summary>
        /// 患者就诊卡号
        /// </summary>
        [StringLength(50)]
        public string CardNo { get; set; } = string.Empty;

        /// <summary>
        /// 就诊科室ID - 外键
        /// </summary>
        public int DepartmentId { get; set; }

        /// <summary>
        /// 挂号费用
        /// </summary>
        [Column(TypeName = "decimal(10,2)")]
        public decimal RegisterFee { get; set; }

        /// <summary>
        /// 其他相关费用
        /// </summary>
        [Column(TypeName = "decimal(10,2)")]
        public decimal OtherFee { get; set; }

        /// <summary>
        /// 挂号日期
        /// </summary>
        public DateTime RegisterDate { get; set; }

        /// <summary>
        /// 实际就诊日期
        /// </summary>
        public DateTime VisitDate { get; set; }

        /// <summary>
        /// 患者姓名
        /// </summary>
        [Required]
        [StringLength(50)]
        public string PatientName { get; set; } = string.Empty;

        /// <summary>
        /// 患者身份证号码
        /// </summary>
        [StringLength(18)]
        public string IDNumber { get; set; } = string.Empty;

        /// <summary>
        /// 患者年龄
        /// </summary>
        public int Age { get; set; }

        /// <summary>
        /// 患者详细住址
        /// </summary>
        [StringLength(200)]
        public string Address { get; set; } = string.Empty;

        /// <summary>
        /// 患者联系电话
        /// </summary>
        [StringLength(20)]
        public string PhoneNumber { get; set; } = string.Empty;

        /// <summary>
        /// 患者所属民族
        /// </summary>
        [StringLength(20)]
        public string Ethnicity { get; set; } = string.Empty;

        /// <summary>
        /// 患者文化程度
        /// </summary>
        [StringLength(50)]
        public string EducationLevel { get; set; } = string.Empty;

        /// <summary>
        /// 患者职业
        /// </summary>
        [StringLength(50)]
        public string Occupation { get; set; } = string.Empty;

        /// <summary>
        /// 患者住址邮政编码
        /// </summary>
        [StringLength(10)]
        public string PostalCode { get; set; } = string.Empty;

        /// <summary>
        /// 患者婚姻状况 - true=已婚, false=未婚
        /// </summary>
        public bool MaritalStatus { get; set; }

        /// <summary>
        /// 患者性别 - true=男, false=女
        /// </summary>
        public bool Gender { get; set; }

        /// <summary>
        /// 患者出生日期
        /// </summary>
        public DateTime DateOfBirth { get; set; }

        /// <summary>
        /// 是否删除 - 逻辑删除，默认false未删除，true已删除
        /// </summary>
        public bool IsDelete { get; set; } = false;

        // 导航属性
        [ForeignKey("RegisterTypeId")]
        public virtual Number_category? RegisterType { get; set; }

        [ForeignKey("DoctorId")]
        public virtual Smart.DoctorInfo? Doctor { get; set; }

        [ForeignKey("DepartmentId")]
        public virtual Smart.DepartmentInfo? Department { get; set; }
    }
} 